define(function(require, exports, module) {
	require("common/umei.dev");

	$(".btn").click(function() {
		var count = $("#count").text();
		if (count == 0) {
			umei.alert("你的下载次数已经用完");
			return;
		}
		umei.postRequest({
			async : true, // 是否异步加载
			url : "checkDownLoad.do", // 请求的url
			fun : function(response) {// 回调方法
				var type = $('input[name="type"]:checked ').val();
				$("#count").text(count - 1);
				document.location.href = "downloadFile.do?type=" + type;
			}
		});
	});
});